extends "../calxgx_1_2/calxgx_1_2.gd"
func _init():
	pass
func _extInit():
	._extInit()
	chaName = "修罗" 
	lv = 4     
	addSkillTxt("[color=#FFFF00][修罗裂空破][/color]:[color=#FFCC22]修罗用裂空之力攻击敌方单体，造成230%光系物理伤害并<束缚>目标3秒\n如果伤害计算后目标最大体力低于30%，则斩杀[CD:20][/color]") 
	addSkillTxt("[color=#000079]难相守[/color]·[color=#004b97]祝[/color][color=#0066cc]福[/color][color=#0080ff]之[/color][color=#46a3ff]愿[/color]-[color=#00BBFF]和百川一同上场时，修罗裂空破如果斩杀目标，则回复全体力值，冷却速度提升50%，持续6秒[/color]")
	addCdSkill("xllkp",20)

var nxs = 0
var zfzy = 0
func _castCdSkill(id):
	._castCdSkill(id)
	if id == "xllkp":
		var eff = sys.newEff("numHit", position, false, 1)
		eff.setText("修罗裂空破", "#FF0099")
		eff.anim.set_speed_scale(0.2)
		typeHurtCha(aiCha,att.atk*2.3,Chara.HurtType.PHY,Chara.AtkType.SKILL)
		aiCha.addBuff(bf.shufu.new(3))
		if aiCha.att.hp/aiCha.att.maxHp < 0.30:
			aiCha.att.hp -= aiCha.att.maxHp
			typeHurtCha(aiCha, 0, Chara.HurtType.REAL, Chara.AtkType.EFF)
			zfzy = 1

func _onBattleStart():
	._onBattleStart()
	zfzy = 0
	nxs = 0
	for i in getAllChas(2):
		if i.chaName.find("百川") > -1:
			nxs = 1

func _onKillChara(atkInfo):
	._onKillChara(atkInfo)
	if zfzy == 1 && nxs == 1:
		plusHp(att.maxHp*1)
		addBuff(lengque3.new(6))
		zfzy = 0

class lengque3:
	extends Buff
	func _init(lv = 1):
		attInit()
		isNegetive=false
		var dispelable = false
		id = "lengque3"	
		att.cd += 0.5
